﻿using In66.Net.Share.Models.OrmType;

namespace Whse.Api
{
    public class AppWebApiDependencyRegistrar : AbstractWebApiDependencyRegistrar
    {
        public AppWebApiDependencyRegistrar(IServiceCollection services)
            : base(services)
        {
        }

        public AppWebApiDependencyRegistrar(IApplicationBuilder app)
            : base(app)
        {
        }

        public override void AddCoreWebApi()
        {
            AddWebApiDefault();
        }

        public override void AddCoreApplication()
        {
            //default
            AddApplicaitonDefault(OrmType.EF);
            AddDomainSerivces<IDomainService>();

            ////rabbitmq
            //AddRabbitMq();

            ////rpc - rest
            //var restPolicies = this.GenerateDefaultRefitPolicies();
            //AddRestClient<IAuthRestClient>(RpcConsts.Usr, restPolicies);
            //AddRestClient<IMaintRestClient>(RpcConsts.Maint, restPolicies);

            //cap
            //AddCapEventBus<CapEventSubscriber>();
        }

        public override void UseCore()
        {
            UseWebApiDefault(endpointRoute: endpoint =>
            {
            });
        }
    }
}
